package com.seashell.appstartupjob.enums;

import com.seashell.appstartupjob.exceptions.JobConfigNotCorrectException;

/**
 * com.seashell.appstartupjob.enums.DestinationPathType
 * 目标地址类型枚举类
 *
 * @author Allen
 * @version v1.0
 * @date 2017/7/17
 */
public enum DestinationPathType {
    /**
     * web容器中
     */
    WEB("web"),
    /**
     * 绝对地址
     */
    ABSOLUTE("absolute");

    private String name;

    DestinationPathType(String name) {
        this.name = name;
    }

    public static DestinationPathType parse(String name){
        if(WEB.name.equalsIgnoreCase(name)){
            return WEB;
        }else if(ABSOLUTE.name.equalsIgnoreCase(name)){
            return ABSOLUTE;
        }else {
            throw new JobConfigNotCorrectException("no such destination path type:"+name);
        }
    }
}
